<!DOCTYPE html>
<html>
<head>
    <title>模具备件库存状况</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp">
    <div>
        <table id="jqGrid"></table>
    </div>
</div>

<script>
    $(function () {
        // 拼接查询参数
        let queryParamArray = [];
        let storeId = getQueryString("storeId");
        let moldSpId = getQueryString("moldSpId");
        if (storeId) {
            queryParamArray.push('storeId=' + storeId);
        }
        if (moldSpId) {
            queryParamArray.push('moldSpId=' + moldSpId);
        }
        let queryString = '';
        if (queryParamArray.length > 0) {
            queryString = '?' + queryParamArray.join('&');
        }
        $("#jqGrid").Grid({
            url: '../modulespstock/list' + queryString,
            multiselect: false,
            colModel: [
                {label: '仓库名称', name: 'storeHouseName', index: 'STORE_ID'},
                {label: '型芯编码', name: 'partCode', index: 'PART_CODE'},
                {label: '型芯备件码', name: 'uniqueCode', index: 'UNIQUE_CODE'},
                {label: '型芯名称', name: 'sparePartsName', index: 'SPARE_PARTS_NAME'},
                {label: '图号', name: 'sparePartsSpec', index: 'SPARE_PARTS_SPEC'},
                {
                    label: '库存状态', name: 'state', index: 'STATE',
                    formatter: function (value) {
                        return sysEnums['MODULE_SPAREPART_STOCK_STATE'][value];
                    }
                },
                {
                    label: '入库时间', name: 'stockInDate', index: 'STOCK_IN_DATE',
                    formatter: function (value) {
                        return transDate(value, 'yyyy-MM-dd hh:mm:ss')
                    }
                },
                {
                    label: '出库时间', name: 'stockOutDate', index: 'STOCK_OUT_DATE',
                    formatter: function (value) {
                        return transDate(value, 'yyyy-MM-dd hh:mm:ss')
                    }
                },
                {label: '备注', name: 'remark', index: 'remark'},
                {label: '采购批次ID', name: 'purchasingBatchId', hidden: true},
                {label: 'id', name: 'id', index: 'ID', key: true, hidden: true},
            ]
        });
    });
</script>
</body>
</html>
